{capture name="hidden"}	
{/capture}
{capture name="fields"}
{literal}
	<script type="text/javascript">
	function pasteShopGroup(form, name, id, value){
		top.opener.window.document.forms['form'+form][name].value=id;
		window.opener.document.forms['form'+form][name+'_just_display'].value=value;
		window.close();
	}
	</script>
{/literal}
<!-- * -->
{ext->class_function class="shop" func="get_all_product_groups" assign="groups_list"}
{if $smarty.get.type_of_product}
	{ext->class_function class="shop" func="get_all_product_groups_one_product_type" groups=$groups_list type=$smarty.get.type_of_product assign="groups_list2"}
	{assign var="groups_list" value=$groups_list2}
{/if}
{ext->aasort array=$groups_list args="+name" assign="groups_list2"}
{assign var="groups_list" value=$groups_list2}
		<table width="100%" cellpadding="3" cellspacing="0">
			<tr>
				<td width="80" height="1"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				<td><img src="client/img/spacer.gif" class="spacer" alt="" /></td>					
			</tr>
			<tr>
				<td>{t t='Produktų tipas'}:</td>
				<td>
					<select name="type_of_product" style="border:1px solid #A8B3B8; width:100%;" onChange="doTheFiltering(this,'type_of_product')">
						<option value="0" {if !$smarty.get.type_of_product}selected{/if}>{t t='Nepasirinkta'}</option>
						{ext->class_function class="shop" func="get_all_types_of_group" assign="all_types_of_product"}
						{foreach from=$all_types_of_product item="el"}
						<option value="{$el.type}"{if $smarty.get.type_of_product==$el.type} selected{/if}>{t t=$el.type}</option>
						{/foreach}		
					</select>				
				</td>
			</tr>			
			<tr>
				<td>{t t='Prekų grupė'}:</td>
				<td>
					<select name="group" style="border:1px solid #A8B3B8; width:100%;" onChange="doTheFiltering(this,'group')">
						<option value="0" {if !$smarty.get.group}selected{/if}>{t t='Nepasirinkta'}</option>
						{foreach from=$groups_list item="el"}
						{if $el.parent == 0}	
						<option value="{$el.id}"{if $smarty.get.group==$el.id} selected{/if}>{$el.name}</option>
						{/if}
						{/foreach}		
					</select>				
				</td>
			</tr>			
		</table>	
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="20"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
	</tr>
	<tr>
		<td>
{if $smarty.get.group || $smarty.get.fresh_select}
{foreach from=$groups_list item="el2"}
{if $el2.parent == $smarty.get.group}		

<!-- * -->
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
	</tr>
</table>
<table cellpadding="0" cellspacing="0"  >
	<tr>		
		<td width="1" height="25"><img src="_tvs_system_core_/design/img/admin/_icon_elements{if $el2.id==$smarty.get.selected}_red{/if}.gif"></td>
		<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		<td ><a href="#" onClick='pasteShopGroup("{$smarty.get.form}","{$smarty.get.name}", {$el2.id}, "{$el2.name|escape:'html'}");' class="blackUnderline">{$el2.name}</a> ({$el2.type})</td>			
	</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
	</tr>
</table>
<!-- /* -->

{/if}
{/foreach}
{else}
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
		<td width="10"><img src="client/img/spacer.gif" width="1" height="1" border="0" alt="" /></td>
		<td height="30" bgcolor="#FFFFFF">{if $smarty.get.fresh_select}{t t='Pasirinkite prekių grupę'}{else}<a href="#" onClick="pasteShopGroup('{$smarty.get.form}','{$smarty.get.name}', 0, '');" target="_self">{t t='Išvalyti pasirinkimą'}</a>{/if}</td>		
	</tr>
</table>
{/if}
		</td>		
	</tr>
</table>
<!-- /* -->
{/capture}
{capture name="fields1"}
	<!-- * -->
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<!-- /* -->
	{ext->class_function class="shop" func="get_all_product_groups" assign="groups_list"}
	{foreach from=$groups_list item="el"}
	{if $el.parent == 0}
	<!-- * -->
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<table cellpadding="0" cellspacing="0">
		<tr>		
			<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td height="22" width="0"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td width="1"><img src="_tvs_system_core_/design/img/document_copy.gif"></td>
			<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
			<td>{$el.name}</td>			
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td height="1"   valign="top" align="center" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
		</tr>
	</table>
	<!-- /* -->
	{foreach from=$groups_list item="el2"}
		{if $el2.parent == $el.id}
			<!-- * -->
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td height="1" bgcolor="#FFFFFF"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				</tr>
			</table>
			<table cellpadding="0" cellspacing="0">
				<tr>		
					<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td height="22" width="20"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td width="1"><img src="_tvs_system_core_/design/img/document_copy.gif"></td>
					<td width="5"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
					<td><a href="#" onClick="window.opener.document.forms['form{$smarty.get.form}']['{$smarty.get.name}'].value='{$el2.id}'; window.opener.document.forms['form{$smarty.get.form}']['{$smarty.get.name}_just_display'].value='{$el2.name|htmlentities}';" class="blackUnderline">{$el2.name}</a></td>			
				</tr>
			</table>
			<table width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td height="1" bgcolor="#D6DBDE"><img src="client/img/spacer.gif" class="spacer" alt="" /></td>
				</tr>
			</table>
			<!-- /* -->
		{/if}
	{/foreach}
	{/if}
{/foreach}
{/capture}


